<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center depositReservation_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub depositReservation_fd0_0'>
					<view class='flex flex-wrap align-center depositReservation_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  depositReservation_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='depositReservation_fd0_0_c1_c0'>定金预留</text>
					</view>
					<view class='flex flex-wrap align-center justify-end depositReservation_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout depositReservation_flex_1">
				<view class='flex flex-wrap align-start depositReservation_fd1_0'>
					<image class='depositReservation_fd1_0_c0' mode="aspectFit" :src='dataVal.cover'></image>
					<view class='flex flex-direction flex-wrap align-stretch flex-sub'>
						<view class='flex flex-wrap align-center depositReservation_fd1_0_c1_c0'>
							<text class='depositReservation_fd1_0_c1_c0_c0'>{{dataVal.address}}</text>
						</view>
						<view class='flex flex-wrap align-center'>
							<text
								class='depositReservation_fd1_0_c1_c1_c0'>{{dataVal.city}}丨{{dataVal.area?dataVal.area:'96'}}㎡丨{{dataVal.building_number}}</text>
						</view>
						<view class='flex flex-wrap align-center depositReservation_fd1_0_c1_c2'>
							<text class='depositReservation_fd1_0_c1_c2_c0'>{{dataVal.expected_rent}}</text>
							<text class='depositReservation_fd1_0_c1_c2_c1'>元</text>
							<text class='depositReservation_fd1_0_c1_c2_c1'>/</text>
							<text class='depositReservation_fd1_0_c1_c2_c1'>月</text>
						</view>
						<view class='flex flex-wrap align-center'>
							<view
								class='flex flex-direction flex-wrap align-center justify-center depositReservation_fd1_0_c1_c3_c0'>
								<text class='depositReservation_fd1_0_c1_c3_c0_c0'>{{dataVal.build_electricity}}</text>
							</view>
						</view>
					</view>
				</view>
				<view class='flex flex-direction flex-wrap align-stretch depositReservation_fd1_1'>
					<view class='flex flex-wrap align-center depositReservation_fd1_1_c0'>
						<view class='flex flex-wrap align-center depositReservation_fd1_1_c0_c0'>
						</view>
						<text class='depositReservation_fd1_1_c0_c1'>相关介绍</text>
					</view>
					<view class='flex flex-wrap align-center justify-between depositReservation_fd1_1_c1'>
						<text class='depositReservation_fd1_1_c1_c0'>客户姓名</text>
						<input class='depositReservation_fd1_1_c1_c1' type="text" :placeholder="`请输入真实姓名`"
							confirm-type="done" :maxlength="7"
							placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx" v-model="real_name" />
					</view>
					<view class='flex flex-wrap align-center justify-between depositReservation_fd1_1_c1'>
						<text class='depositReservation_fd1_1_c1_c0'>客户电话</text>
						<input class='depositReservation_fd1_1_c1_c1' type="number" :placeholder="`请输入手机号码`"
							confirm-type="done" :maxlength="11"
							placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx"  v-model="phone" />
					</view>
					<view class='flex flex-wrap align-center justify-between depositReservation_fd1_1_c1'>
						<text class='depositReservation_fd1_1_c1_c0'>证件类型</text>
						<view class='flex flex-wrap align-center' @tap.stop="pickerDiy1695806803484=true">
							<input class='depositReservation_fd1_1_c3_c1' type="text" :placeholder="`请选择`"
								confirm-type="done" :maxlength="-1" disabled
								placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx"
								v-model="passPortName" />
							<image class='depositReservation_fd1_1_c3_c2' mode="aspectFit" :src='STATIC_URL+"63.png"'>
							</image>
						</view>
					</view>
					<view class='flex flex-wrap align-center justify-between depositReservation_fd1_1_c1'>
						<text class='depositReservation_fd1_1_c1_c0'>证件号码</text>
						<input class='depositReservation_fd1_1_c1_c1' type="number" :placeholder="`请输入证件号码`"
							confirm-type="done" :maxlength="-1"
							placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx" maxlength="18" v-model="idNo" />
					</view>
					<view class='flex flex-wrap align-center justify-between depositReservation_fd1_1_c5'>
						<text class='depositReservation_fd1_1_c1_c0'>入住人数</text>
						<view class='flex flex-wrap align-center depositReservation_fd1_1_c5_c1'>
							<input class='depositReservation_fd1_1_c5_c1_c0' type="number" :placeholder="``"
								confirm-type="done" :maxlength="3" placeholder-style="color:#999;font-size:28rpx" v-model="occupancy" />
						</view>
						<text class='depositReservation_fd1_1_c5_c2'>人</text>
					</view>
				</view>
				<view class='flex flex-direction flex-wrap align-stretch depositReservation_fd1_1'>
					<view class='flex flex-wrap align-center depositReservation_fd1_1_c0'>
						<view class='flex flex-wrap align-center depositReservation_fd1_1_c0_c0'>
						</view>
						<text class='depositReservation_fd1_1_c0_c1'>定金信息</text>
					</view>
					<text class='depositReservation_fd1_2_c1'>定金金额/日期</text>
					<view class='flex flex-wrap align-center'>
						<benben-select-diy ref="showSelectPopup1695725572081" class-name='flex flex' :items.sync="price"
							:label.sync="jinename" v-model="jineid" default-type="value" default-label="name" :allow-cancel='false' type="radio"
							:disabled='false'>
							<template v-for='(item,key0) in price'>
								<view v-if="item.isSelected"
									class='flex align-center justify-center flex depositReservation_fd1_2_c2_c0_c0'
									:key="key0" @tap="$refs.showSelectPopup1695725572081.tapHandle(key0)">
									<text class='depositReservation_fd1_2_c2_c0_c0_c0'>{{item.name}}</text>
								</view>
								<view v-else
									class='flex flex-direction align-center justify-center flex depositReservation_fd1_2_c2_c0_c1'
									:key="key0" @tap="$refs.showSelectPopup1695725572081.tapHandle(key0)">
									<text class='depositReservation_fd1_2_c2_c0_c1_c0'>{{item.name}}</text>
								</view>
							</template></benben-select-diy>
					</view>
					<text class='depositReservation_fd1_2_c3'>定金为阶梯形式；例如缴纳300元，房源保留3天，缴纳500
						元，房源保留5天；用户自主选择；需在房源有效期之前缴纳
						尾款，否则定金不退；</text>
				</view>
				<view class='flex flex-direction flex-wrap align-stretch depositReservation_fd1_3'>
					<view class='flex flex-wrap align-center depositReservation_fd1_3_c0'>
						<view class='flex flex-wrap align-center depositReservation_fd1_1_c0_c0'>
						</view>
						<text class='depositReservation_fd1_1_c0_c1'>预定规则</text>
					</view>
					<text
						class='depositReservation_fd1_3_c1'>房源预定人取消房源预定政策，在支付预定金后您可以在72小时内无条件取消预定单，超时未确认定单（未支付尾款）的视您自愿放弃该预定单和预定金退回权利</text>
				</view>
				<view class='flex flex-wrap align-center justify-center depositReservation_fd1_4' @click.top="clickOfferPay">
					<text class='depositReservation_fd1_4_c0'>确认缴纳</text>
					<text class='depositReservation_fd1_4_c0'>{{jinename}}</text>
					<!-- <text class='depositReservation_fd1_4_c0'>元</text> -->
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!--选择器开始 -->
			<benben-picker ref="benbenWritePickerCodepicker2" :visible.sync="pickerDiy1695806803484"
				:label.sync='passPortName' :value.sync='id' :options='passPortType' mode='selector' :mask-show='true'
				:timeout='true' :picker-height='88' default-type='value'
				:default-props='{"label":"name","value":"value"}'>
				<template #picker-header>
					<view class='flex flex-wrap align-center justify-between fireSupervision_picker2_0'>
						<text class='fireSupervision_picker2_0_c0'
							@tap="$refs.benbenWritePickerCodepicker2.cancel()">取消</text>
						<text class='fireSupervision_picker2_0_c1'>证件类型</text>
						<text class='fireSupervision_picker2_0_c2'
							@tap="$refs.benbenWritePickerCodepicker2.pickerConfirm()">确认</text>
					</view>
				</template>
			</benben-picker>
			<!--选择器结束 -->

		</view>
	</view>
</template>
<script>
	export default {
		components: {},


		data() {
			return {
				"pickerDiy1695806803484": false,
				"price": [{
					"name": "300元/3天",
					"value": "1",
					"image": ""
				}, {
					"name": "500元/5天",
					"value": "2",
					"image": ""
				}, {
					"name": "800元/8天",
					"value": "3",
					"image": ""
				}],
				"id": "",
				"passPortType": [{
					"name": "身份证",
					"value": "1"

				}, {
					"name": "护照",
					"value": "2"
				}],
				passPortName: '', //证件类型
				dataVal: {},
				real_name: '',
				phone: '',
				idNo: '',
				occupancy: '',
				id:'', //定金选择id
				jineid:'1',
				jinename:''
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			if (options.data) {
				this.dataVal = JSON.parse(options.data)
				console.log(this.dataVal);
			}
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			clickOfferPay(){
				if(!this.real_name){
					this.$message.info('客户姓名')
					return false
				}
				if(!this.phone){
					this.$message.info('客户电话')
					return false
				}
				if(!this.passPortName){
					this.$message.info('证件类型')
					return false
				}
				if(!this.idNo){
					this.$message.info('证件号码')
					return false
				}
				if(!this.occupancy){
					this.$message.info('入住人数')
					return false
				}
				if(!this.jineid){
					this.$message.info('定金金额')
					return false
				}
				let price = ''
				if(this.jineid == '1'){
					price = '300'
				}else if(this.jineid == '2'){
					price = '500'
				}else if(this.jineid == '2'){
					price = '800'
				}
				// this.$message.info('暂未开通支付')
				this.$api.post('/m6752/677e402b7a41b',{
					house_id:this.dataVal.aid
				}).then(res=>{
					if(res.data.code == 1){
						this.$message.info(res.data.msg)
						setTimeout(()=>{
							uni.redirectTo({
								url:`/pages/zfmk/resultPayment/resultPayment?aid=${res.data.data.aid}`
							})
						},500)
					}else{
						this.$message.info(res.data.msg)
					}
				})
				
				// let data = {
				// 	name:this.real_name,
				// 	tel:this.phone,
				// 	house_id:this.dataVal.id,
				// 	card_no:this.idNo,
				// 	room_num:this.occupancy,
				// 	deposit_id:this.id
				// }
				// this.$api.post('/m6752/656709e0e90d0',data).then(res=>{
				// 	if(res.data.code == 1){
				// 		this.$message.info(res.data.msg)
				// 		setTimeout(()=>{
				// 			uni.navigateTo({
				// 				url:'/pages/zfmk/offerPay/offerPay'
				// 			})
				// 		},500)
				// 	}else{
				// 		this.$message.info(res.data.msg)
				// 	}
				// })
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F8F8F8;
		background-size: 100% auto;
	}

	.fireSupervision_picker2_0 {
		background: #FFFFFF;
		height: 80rpx;
		padding: 0 20px;
		box-sizing: border-box;
	}

	.depositReservation_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.depositReservation_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 36rpx;
	}

	.depositReservation_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.depositReservation_fd0_0_c0 {
		width: 120rpx;
	}

	.depositReservation_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.depositReservation_flex_1 {
		padding: 24rpx 24rpx 0rpx 24rpx;
	}

	.depositReservation_fd1_4_c0 {
		color: #FFFFFF;
		font-size: 32rpx;
		font-weight: 500;
		line-height: 32rpx;
	}

	.depositReservation_fd1_4 {
		background: #FC5F80;
		border-radius: 60rpx 60rpx 60rpx 60rpx;
		width: 638rpx;
		height: 88rpx;
		margin: 0rpx 0rpx 40rpx 32rpx;
	}

	.depositReservation_fd1_3_c1 {
		color: #666666;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 48rpx;
	}

	.depositReservation_fd1_3_c0 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 0rpx 24rpx 0rpx;
		margin: 0rpx 0rpx 31rpx 0rpx;
	}

	.depositReservation_fd1_3 {
		background: var(--benbenbgColor1);
		margin: 0rpx 0rpx 32rpx 0rpx;
		padding: 32rpx 24rpx 32rpx 24rpx;
		border-radius: 16rpx;
		background-size: 100% auto;
	}

	.depositReservation_fd1_2_c3 {
		color: #666666;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 40rpx;
		margin: 24rpx 0rpx 32rpx 0rpx;
	}

	.depositReservation_fd1_2_c2_c0_c1_c0 {
		color: #333333;
		font-size: 24rpx;
		font-weight: 400;
	}

	.depositReservation_fd1_2_c2_c0_c1 {
		background: #F8F8F8;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		width: 164rpx;
		height: 64rpx;
		margin: 0rpx 10rpx 0rpx 0rpx;
	}

	.depositReservation_fd1_2_c2_c0_c0_c0 {
		color: #FFFFFF;
		font-size: 24rpx;
		font-weight: 400;
	}

	.depositReservation_fd1_2_c2_c0_c0 {
		background: #FC5F80;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		width: 164rpx;
		height: 64rpx;
		margin: 0rpx 10rpx 0rpx 0rpx;
	}

	.depositReservation_fd1_2_c1 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
		margin: 32rpx 0rpx 24rpx 0rpx;
	}

	.depositReservation_fd1_1_c5_c2 {
		color: #999999;
		font-size: 32rpx;
		font-weight: 400;
		margin: 0rpx 0rpx 0rpx 16rpx;
	}

	.depositReservation_fd1_1_c5_c1_c0 {
		text-align: center;
		color: #333;
		font-size: 32rpx;
	}

	.depositReservation_fd1_1_c5_c1 {
		background: #F8F8F8;
		margin: 0rpx 0rpx 0rpx auto;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		width: 120rpx;
		height: 64rpx;
	}

	.depositReservation_fd1_1_c5 {
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.depositReservation_fd1_1_c3_c2 {
		width: 28rpx;
		height: 28rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 0rpx 15rpx;
	}

	.depositReservation_fd1_1_c3_c1 {
		text-align: right;
		color: var(--benbenFontColor1);
		font-size: 32rpx;
		margin: 0rpx 0rpx 0rpx auto;
	}

	.depositReservation_fd1_1_c1_c1 {
		text-align: right;
		color: var(--benbenFontColor1);
		font-size: 32rpx;
	}

	.depositReservation_fd1_1_c1_c0 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
	}

	.depositReservation_fd1_1_c1 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.depositReservation_fd1_1_c0_c1 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 500;
		line-height: 36rpx;
	}

	.depositReservation_fd1_1_c0_c0 {
		background: #FC5F80;
		width: 8rpx;
		height: 28rpx;
		border-radius: 30rpx 30rpx 30rpx 30rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
	}

	.depositReservation_fd1_1_c0 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 0rpx 24rpx 0rpx;
	}

	.depositReservation_fd1_1 {
		background: var(--benbenbgColor1);
		margin: 0rpx 0rpx 24rpx 0rpx;
		padding: 0rpx 23rpx 0rpx 25rpx;
		border-radius: 16rpx;
		background-size: 100% auto;
	}

	.depositReservation_fd1_0_c1_c3_c0_c0 {
		color: #EA4040;
		font-size: 20rpx;
		font-weight: 400;
		line-height: 22rpx;
	}

	.depositReservation_fd1_0_c1_c3_c0 {
		background: rgba(253, 235, 235, 1);
		border-radius: 6rpx 6rpx 6rpx 6rpx;
		padding: 1rpx 8rpx 1rpx 8rpx;
	}

	.depositReservation_fd1_0_c1_c2_c1 {
		color: #EA3727;
		font-size: 24rpx;
		font-weight: 600;
	}

	.depositReservation_fd1_0_c1_c2_c0 {
		color: #EA3727;
		font-size: 32rpx;
		font-weight: 700;
		line-height: 45rpx;
	}

	.depositReservation_fd1_0_c1_c2 {
		margin: 16rpx 0rpx 16rpx 0rpx;
	}

	.depositReservation_fd1_0_c1_c1_c4 {
		color: #666666;
		font-size: 22rpx;
		font-weight: 400;
		line-height: 30rpx;
	}

	.depositReservation_fd1_0_c1_c1_c0 {
		color: #666666;
		font-size: 22rpx;
		font-weight: 400;
		line-height: 22rpx;
	}

	.depositReservation_fd1_0_c1_c0_c0 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 500;
		line-height: 40rpx;
	}

	.depositReservation_fd1_0_c1_c0 {
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.depositReservation_fd1_0_c0 {
		width: 216rpx;
		height: 192rpx;
		margin: 0rpx 20rpx 0rpx 0rpx;
		border-radius: 16rpx;
	}

	.depositReservation_fd1_0 {
		background: var(--benbenbgColor1);
		margin: 0rpx 0rpx 24rpx 0rpx;
		padding: 24rpx;
		border-radius: 16rpx;
		background-size: 100% auto;
	}
</style>